import React from 'react'
import {HashRouter, Route, Link, Redirect} from 'react-router-dom'

import Home from '@/components/child/home'
import Movie from '@/components/child/movie'
import About from '@/components/child/about'

export default class App extends React.Component {
  render() {
    return <HashRouter>
      <div>
        <Link to="/home">首页</Link>&nbsp;&nbsp;
        <Link to="/movie/12313">电影</Link>&nbsp;&nbsp;
        <Link to={`/about`}>关于</Link>

        <Route exact path="/" render={()=> <Redirect to="/home"></Redirect>}></Route>
        <Route path="/home" component={Home}></Route>
        <Route path="/movie/12313" component={Movie} exact></Route>
        <Route path="/about/:username?" component={About}></Route>
      </div>
    </HashRouter>
  }
}